package com.tsd.system.dao;

import com.tsd.core.vo.PageBean;
import com.tsd.system.entity.SysRoleDataAccessRule;
import com.tsd.system.entity.SysRoleDataAccessRuleExt;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 描述：SysRoleDataAccessRuleMapper
 *
 * @author david
 * @date 2021/07/08 15:49:18
 */
public interface SysRoleDataAccessRuleMapper {

    SysRoleDataAccessRule selectByPrimaryKey(Long id);

    SysRoleDataAccessRuleExt selectBySid(String sid);

    int deleteByPrimaryKey(Long id);

    int insert(SysRoleDataAccessRule record);

    int insertSelective(SysRoleDataAccessRule record);

    int insertList(List<SysRoleDataAccessRule> list);

    int updateByPrimaryKey(SysRoleDataAccessRule record);

    int updateByPrimaryKeySelective(SysRoleDataAccessRule record);

    List<SysRoleDataAccessRuleExt> selectByEntity(SysRoleDataAccessRule record);

    List<SysRoleDataAccessRuleExt> selectByPage(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<SysRoleDataAccessRuleExt> selectCount1Page(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<SysRoleDataAccessRuleExt> selectByParams(@Param("params") Map<String, Object> params);
    //批量插入，mysql默认接受sql的大小是1048576(1M)，此方式若数据量超过1M会报如下异常：（可通过调整MySQL安装目录下的my.ini文件中[mysqld]段的＂max_allowed_packet = 1M＂）
    //void insertList(List<SysRoleDataAccessRule> list);

    int deleteList(@Param("role_sid") String role_sid);

    List<SysRoleDataAccessRule> selectValidByRoleList(@Param("role_list") List<String> roleList);
}